package com.yshebkb.sulp.controller;

import com.yshebkb.sulp.domain.RestResponse;
import com.yshebkb.sulp.exception.AppException;
import com.yshebkb.sulp.exception.ErrorCodes;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author yshebkb
 * @date 2018/7/25
 */
@RestController
@RequestMapping("/api/error")
public class ErrorController {

    @RequestMapping("/403")
    public RestResponse unauthorizedRole() {
        throw new AppException(ErrorCodes.UN_AUTHORIZED);
    }

    @RequestMapping("/404")
    public RestResponse pageNotFound() {
        throw new AppException(ErrorCodes.PAGE_NOT_FOUND);
    }
}
